from flask import Blueprint

from app.Controllers.BaseController import BaseController
from app.Service.ChemometricsTutorialsServices.UnivariateAnalysisService import UnivariateAnalysisService

ua = Blueprint('ua', __name__)


@ua.route('/')
def index():
    return BaseController().successData(msg="it's UA")


@ua.route('/getSingleRegression', methods=['POST'])
def UASingleRegression():
    UA = UnivariateAnalysisService().UACommomProcess()
    result = UnivariateAnalysisService().getSingleRegressionModel(UA)
    return result


@ua.route('/getDoubleRegression', methods=['POST'])
def UADoubleRegression():
    UA = UnivariateAnalysisService().UACommomProcess()
    result = UnivariateAnalysisService().getDoubleRegressionModel(UA)
    return result


@ua.route('/getBootStrapping', methods=['POST'])
def UABootstrapping():
    UA = UnivariateAnalysisService().UACommomProcess()
    result = UnivariateAnalysisService().bootstrapping(UA)
    return result
